package com.qdlc.p2p.biz.executer.impl;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.executer.BaseExecuter;
import com.qdlc.p2p.biz.service.UserVipUpRateService;
import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.constant.LogTplNid;
import com.qdlc.p2p.common.util.BeanUtil;
import com.qdlc.p2p.dal.dto.BorrowTender;
/**
 * 满审成功生成vip加息
 * @author zlhx
 * @version 2.0
 * @date 2015-06-17 14:25
 */
@Service
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class VipUpRateExecuter extends BaseExecuter {
	private String accountLogType = LogTplNid.VIP_UP_RATE_INTEREST_COLLECTION;
	
	@Override
	public String getAccountLogType() {
		return accountLogType;
	}

	@Override
	public String getLogRemark() {
		return "";

	}

	@Override
	public void extend() {
		UserVipUpRateService userVipUpRateService = (UserVipUpRateService) BeanUtil.getBean("userVipUpRateService");
		Object obj1 = Global.getTransfer().get("extraRate");
		Object obj2 = Global.getTransfer().get("borrowTender");
		double extraRate = 0;
		BorrowTender borrowTender = null;
		if(obj1 != null){
			extraRate = (Double) obj1;
		}
		if(obj2 != null){
			borrowTender = (BorrowTender) obj2;
		}
		userVipUpRateService.borrowSuccessVipUpRate(borrowTender, accountLogType, extraRate);
	}
}
